<!DOCTYPE html>
<html lang="zh-cn">
<head prefix="og: http://ogp.me/ns#">
  <meta charset="utf-8">
  <title>starRTC文档</title>
  <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <!-- Canonical links -->
  <link rel="canonical" href="https://starrtc.gitee.io/update/index.html">
  <!-- Alternative links -->
  
    
      <link rel="alternative" hreflang="en" href="https://starrtc.gitee.io/update/index.html">
    
      <link rel="alternative" hreflang="zh-cn" href="https://starrtc.gitee.io/zh-cn/update/index.html">
    
  
  <!-- Icon -->
  <link rel="apple-touch-icon" sizes="57x57" href="/icon/apple-touch-icon-57x57.png">
  <link rel="apple-touch-icon" sizes="114x114" href="/icon/apple-touch-icon-114x114.png">
  <link rel="apple-touch-icon" sizes="72x72" href="/icon/apple-touch-icon-72x72.png">
  <link rel="apple-touch-icon" sizes="144x144" href="/icon/apple-touch-icon-144x144.png">
  <link rel="apple-touch-icon" sizes="60x60" href="/icon/apple-touch-icon-60x60.png">
  <link rel="apple-touch-icon" sizes="120x120" href="/icon/apple-touch-icon-120x120.png">
  <link rel="apple-touch-icon" sizes="76x76" href="/icon/apple-touch-icon-76x76.png">
  <link rel="apple-touch-icon" sizes="152x152" href="/icon/apple-touch-icon-152x152.png">
  <link rel="icon" type="image/png" href="/icon/favicon-196x196.png" sizes="196x196">
  <link rel="icon" type="image/png" href="/icon/favicon-160x160.png" sizes="160x160">
  <link rel="icon" type="image/png" href="/icon/favicon-96x96.png" sizes="96x96">
  <link rel="icon" type="image/png" href="/icon/favicon-16x16.png" sizes="16x16">
  <link rel="icon" type="image/png" href="/icon/favicon-32x32.png" sizes="32x32">
  <meta name="msapplication-TileColor" content="#2f83cd">
  <meta name="msapplication-TileImage" content="/icon/mstile-144x144.png">
  <!-- CSS -->
  <!-- build:css build/css/navy.css -->
  <link rel="stylesheet" href="/css/navy.css">
  <!-- endbuild -->
  <link href="https://starrtc.gitee.io/googleapis.css" rel="stylesheet" type="text/css">
 <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css"> 
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/docsearch.js/1/docsearch.min.css">
  <!-- RSS -->
  <link rel="alternate" href="/atom.xml" title="starRTC文档">
  <!-- Open Graph -->
  <meta name="description" content="更新记录Android版本v1.0.1    时间：201802021 优化StarIMMessage结构，去掉elem层，使消息解析更简单。 2 优化消息发送流程以发送c2c消息为例：//v1.0.0//先创建消息对象再发送StarIMMessage message = StarIMMessageBuilder.getC2CMessage(MLOC.userId, mTargetId, msg)">
<meta property="og:type" content="website">
<meta property="og:title" content="starRTC文档">
<meta property="og:url" content="https://starrtc.gitee.io/update/index.html">
<meta property="og:site_name" content="starRTC文档">
<meta property="og:description" content="更新记录Android版本v1.0.1    时间：201802021 优化StarIMMessage结构，去掉elem层，使消息解析更简单。 2 优化消息发送流程以发送c2c消息为例：//v1.0.0//先创建消息对象再发送StarIMMessage message = StarIMMessageBuilder.getC2CMessage(MLOC.userId, mTargetId, msg)">
<meta property="og:locale" content="zh-cn">
<meta property="og:updated_time" content="2020-09-06T00:27:31.361Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="starRTC文档">
<meta name="twitter:description" content="更新记录Android版本v1.0.1    时间：201802021 优化StarIMMessage结构，去掉elem层，使消息解析更简单。 2 优化消息发送流程以发送c2c消息为例：//v1.0.0//先创建消息对象再发送StarIMMessage message = StarIMMessageBuilder.getC2CMessage(MLOC.userId, mTargetId, msg)">
<meta name="twitter:site" content="hexojs">
<meta property="fb:admins" content="100000247608790">
  <!-- Google Analytics -->
  
</head>

<body>
  <div id="container">
    <header id="header" class="wrapper">
  <div id="header-inner" class="inner">
    <h1 id="logo-wrap">
      
      <a href="https://starrtc.gitee.io/" id="logo">starRTC</a>
    </h1>
    <nav id="main-nav">
      <a href="https://starrtc.gitee.io/" class="main-nav-link">官网</a><a href="https://blog.starRTC.com" class="main-nav-link">博客</a><a href="https://github.com/starrtc/android-demo/issues" class="main-nav-link">论坛</a><a href="/zh-cn/docs/" class="main-nav-link">文档</a><a href="/zh-cn/download/" class="main-nav-link">下载</a><a href="/zh-cn/contact/" class="main-nav-link">联系我们</a>
      
    </nav>
    <div id="lang-select-wrap">
      <label id="lang-select-label"><i class="fa fa-globe"></i><span>简体中文</span></label>
      <select id="lang-select" data-canonical="">
        
          <option value="en">English</option>
        
          <option value="zh-cn" selected>简体中文</option>
        
      </select>
    </div>
    <a id="mobile-nav-toggle">
      <span class="mobile-nav-toggle-bar"></span>
      <span class="mobile-nav-toggle-bar"></span>
      <span class="mobile-nav-toggle-bar"></span>
    </a>
  </div>
</header>

    <div id="content-wrap">
  <div id="content" class="wrapper">
    <div id="content-inner">
      <article class="article-container" itemscope itemtype="http://schema.org/Article">
        <div class="article-inner">
          <div class="article">
            <div class="inner">
              <header class="article-header">
                <h1 class="article-title" itemprop="name"></h1>
                <a href="https://github.com/starRTC/docs/edit/master/update/index.md" class="article-edit-link" title="改进本文"><i class="fa fa-pencil"></i></a>
              </header>
              <div class="article-content" itemprop="articleBody">
                <h1 id="更新记录" class="article-heading"><a href="#更新记录" class="headerlink" title="更新记录"></a>更新记录<a class="article-anchor" href="#更新记录" aria-hidden="true"></a></h1><h2 id="Android" class="article-heading"><a href="#Android" class="headerlink" title="Android"></a>Android<a class="article-anchor" href="#Android" aria-hidden="true"></a></h2><h2 id="版本v1-0-1-时间：20180202" class="article-heading"><a href="#版本v1-0-1-时间：20180202" class="headerlink" title="版本v1.0.1    时间：20180202"></a>版本v1.0.1    时间：20180202<a class="article-anchor" href="#版本v1-0-1-时间：20180202" aria-hidden="true"></a></h2><p>1 优化StarIMMessage结构，去掉elem层，使消息解析更简单。</p>
<p>2 优化消息发送流程<br>以发送c2c消息为例：<br><figure class="highlight java"><table><tr><td class="code"><pre><span class="line"><span class="comment">//v1.0.0</span></span><br><span class="line"><span class="comment">//先创建消息对象再发送</span></span><br><span class="line">StarIMMessage message = StarIMMessageBuilder.getC2CMessage(MLOC.userId, mTargetId, msg);</span><br><span class="line">StarManager.getInstance().sendMessage(message);</span><br><span class="line">StarManager.getInstance().sendOnLineMessage(message);</span><br><span class="line"></span><br><span class="line"><span class="comment">//v1.0.1</span></span><br><span class="line"><span class="comment">//省去创建消息对象的步骤</span></span><br><span class="line">StarManager.getInstance().sendMessage( mTargetId, msg);</span><br><span class="line">StarManager.getInstance().sendOnLineMessage( mTargetId, msg);</span><br></pre></td></tr></table></figure></p>
<p>3 优化VOIP部分API<br>  去掉接口参数中传入的自身ID,这个值SDK可以自行补充。<br><figure class="highlight java"><table><tr><td class="code"><pre><span class="line"><span class="comment">//v1.0.0</span></span><br><span class="line">StarManager.getInstance().initVoip(isCaller,MLOC.userId,targetId,</span><br><span class="line">        <span class="keyword">this</span>, <span class="keyword">new</span> StarLiveConfig(), </span><br><span class="line">        targetPlayer, selfPlayer, <span class="keyword">new</span> IStarCallback() &#123;</span><br><span class="line">    <span class="meta">@Override</span></span><br><span class="line">    <span class="function"><span class="keyword">public</span> <span class="keyword">void</span> <span class="title">callback</span><span class="params">(<span class="keyword">boolean</span> reqSuccess, String statusCode, String data)</span> </span>&#123;</span><br><span class="line">        <span class="keyword">if</span> (reqSuccess)&#123;</span><br><span class="line">            runOnUiThread(<span class="keyword">new</span> Runnable() &#123;</span><br><span class="line">                <span class="meta">@Override</span></span><br><span class="line">                <span class="function"><span class="keyword">public</span> <span class="keyword">void</span> <span class="title">run</span><span class="params">()</span> </span>&#123;</span><br><span class="line">                    <span class="keyword">if</span>(action.equals(CALLING))&#123;</span><br><span class="line">                        showCallingView();</span><br><span class="line">                        StarManager.getInstance().voipCall(MLOC.userId,targetId);</span><br><span class="line">                    &#125;<span class="keyword">else</span>&#123;</span><br><span class="line">                        showRingView();</span><br><span class="line">                    &#125;</span><br><span class="line">                &#125;</span><br><span class="line">            &#125;);</span><br><span class="line">        &#125;<span class="keyword">else</span>&#123;</span><br><span class="line">            MLOC.showMsg(<span class="string">"initEncoder ERROR!!!"</span>);</span><br><span class="line">            removeListener();</span><br><span class="line">            finish();</span><br><span class="line">        &#125;</span><br><span class="line">    &#125;</span><br><span class="line">&#125;);</span><br><span class="line"></span><br><span class="line">StarManager.getInstance().voipRefuse(MLOC.userId,targetId);</span><br><span class="line">StarManager.getInstance().voipConnect(MLOC.userId,targetId);</span><br><span class="line">StarManager.getInstance().voipHangup(MLOC.userId,targetId);</span><br><span class="line"></span><br><span class="line"><span class="comment">//v1.0.1</span></span><br><span class="line">StarManager.getInstance().initVoip(isCaller,targetId,</span><br><span class="line">        <span class="keyword">this</span>, <span class="keyword">new</span> StarLiveConfig(), </span><br><span class="line">        targetPlayer, selfPlayer, <span class="keyword">new</span> IStarCallback() &#123;</span><br><span class="line">    <span class="meta">@Override</span></span><br><span class="line">    <span class="function"><span class="keyword">public</span> <span class="keyword">void</span> <span class="title">callback</span><span class="params">(<span class="keyword">boolean</span> reqSuccess, String statusCode, String data)</span> </span>&#123;</span><br><span class="line">        <span class="keyword">if</span> (reqSuccess)&#123;</span><br><span class="line">            runOnUiThread(<span class="keyword">new</span> Runnable() &#123;</span><br><span class="line">                <span class="meta">@Override</span></span><br><span class="line">                <span class="function"><span class="keyword">public</span> <span class="keyword">void</span> <span class="title">run</span><span class="params">()</span> </span>&#123;</span><br><span class="line">                    <span class="keyword">if</span>(action.equals(CALLING))&#123;</span><br><span class="line">                        showCallingView();</span><br><span class="line">                        StarManager.getInstance().voipCall(targetId);</span><br><span class="line">                    &#125;<span class="keyword">else</span>&#123;</span><br><span class="line">                        showRingView();</span><br><span class="line">                    &#125;</span><br><span class="line">                &#125;</span><br><span class="line">            &#125;);</span><br><span class="line">        &#125;<span class="keyword">else</span>&#123;</span><br><span class="line">            MLOC.showMsg(<span class="string">"initEncoder ERROR!!!"</span>);</span><br><span class="line">            removeListener();</span><br><span class="line">            finish();</span><br><span class="line">        &#125;</span><br><span class="line">    &#125;</span><br><span class="line">&#125;);</span><br><span class="line"></span><br><span class="line">StarManager.getInstance().voipRefuse(targetId);</span><br><span class="line">StarManager.getInstance().voipConnect(targetId);</span><br><span class="line">StarManager.getInstance().voipHangup(targetId);</span><br></pre></td></tr></table></figure></p>

              </div>
              <footer class="article-footer">
                <time class="article-footer-updated" datetime="2020-09-06T00:27:31.361Z" itemprop="dateModified">上次更新<script type="text/javascript">document.write("："+(new Date()).toISOString().slice(0,10))</script></time>
		
              </footer>
            </div>
          </div>
          <aside id="article-toc" role="navigation">
            <div id="article-toc-inner">
              <strong class="sidebar-title">目录</strong>
              <ol class="toc"><li class="toc-item toc-level-1"><a class="toc-link" href="#更新记录"><span class="toc-text">更新记录</span></a><ol class="toc-child"><li class="toc-item toc-level-2"><a class="toc-link" href="#Android"><span class="toc-text">Android</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#版本v1-0-1-时间：20180202"><span class="toc-text">版本v1.0.1    时间：20180202</span></a></li></ol></li></ol>
              <a href="#" id="article-toc-top">回到顶部</a>
            </div>
          </aside>
        </div>
      </article>
      <aside id="sidebar" role="navigation">
  <div class="inner">
    
  </div>
</aside>
    </div>
  </div>
</div>

    <footer id="footer" class="wrapper">
  <div class="inner">
    <div id="footer-copyright">
      &copy; 2010-2020 <a href="https://starrtc.gitee.io/" target="_blank">starRTC</a><br>
    </div>
    <div id="footer-links">
      <a href="https://gitee.com/starrtc" class="footer-link" target="_blank"><i class="fa fa-github-alt"></i></a>
    </div>
  </div>
</footer>

  </div>
  <div id="mobile-nav-dimmer"></div>
  <nav id="mobile-nav">
  <div id="mobile-nav-inner">
    <ul id="mobile-nav-list">
      <a href="https://starrtc.gitee.io/" class="main-nav-link">官网</a><a href="https://blog.starRTC.com" class="main-nav-link">博客</a><a href="https://github.com/starrtc/android-demo/issues" class="main-nav-link">论坛</a><a href="/zh-cn/docs/" class="mobile-nav-link">文档</a><a href="/zh-cn/download/" class="mobile-nav-link">下载</a><a href="/zh-cn/contact/" class="mobile-nav-link">联系我们</a>
      <li class="mobile-nav-item">
        <a href="https://github.com/starrtc" class="mobile-nav-link" rel="external" target="_blank">GitHub</a>
      </li>
    </ul>
    
      
    
  </div>
  <div id="mobile-lang-select-wrap">
    <span id="mobile-lang-select-label"><i class="fa fa-globe"></i><span>简体中文</span></span>
    <select id="mobile-lang-select" data-canonical="">
      
        <option value="en">English</option>
      
        <option value="zh-cn" selected>简体中文</option>
      
    </select>
  </div>
</nav>
  <!-- Scripts -->
<!-- build:js build/js/main.js -->
<script src="/js/lang_select.js"></script>
<script src="/js/toc.js"></script>
<script src="/js/mobile_nav.js"></script>
<!-- endbuild -->
<!-- Algolia -->

<script type="text/javascript" src="https://cdn.jsdelivr.net/docsearch.js/1/docsearch.min.js"></script>
<script type="text/javascript">
document.getElementById('search-input-wrap').classList.add('on');
docsearch({
  apiKey: 'cdea7d4e47d84f6145b77e7f68689f35',
  indexName: 'hexo_zh-cn',
  inputSelector: '#search-input'
});
</script>


</body>
</html>